/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.container-fluid {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.game-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.game-header h1 {
    margin: 0;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-container img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.user-details {
    text-align: right;
}

#username-display {
    font-weight: bold;
    font-size: 16px;
}

#user-coins {
    font-size: 14px;
    color: #f1c40f;
}

/* 主内容区域 */
.lobby-main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 房间列表区域 */
.room-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-header h2 {
    margin: 0;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* 筛选区域 */
.room-filters {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.room-filters label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* 房间列表 */
.room-list-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 底部样式 */
.game-footer {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* 用户设置模态框 */
.avatar-setup img {
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.avatar-setup img:hover {
    border-color: #3498db;
}

.avatar-grid img {
    margin: 5px;
    border: 2px solid transparent;
}

.avatar-grid img:hover {
    border-color: #3498db;
}

/* 游戏规则模态框 */
.rules-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.rules-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.rules-content ul, .rules-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-content li {
    margin-bottom: 5px;
    line-height: 1.5;
}

/* 创建房间表单 */
.create-room-form {
    max-height: 400px;
    overflow-y: auto;
}

.form-check {
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .room-filters .row {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th, .table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 20px;
    }
    
    .lobby-main {
        padding: 10px;
    }
    
    .room-section {
        padding: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th, .table td {
        padding: 6px 8px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}